package com.java.zhuiyun.api.sys_role_menu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java.zhuiyun.api.sys_role_menu.entity.RoleMenu;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @InterfaceName RoleMenuMapper
 * @Description TODO
 * @Author xy
 * @Date 2023/8/16 20:56
 **/
@Mapper
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {

    @Delete("delete from sys_role_menu where role_id = #{roleId}")
//    @Update("update sys_role_menu set del_flag = 1 where id = #{id}")
    int deleteByRoleId(@Param("roleId") Integer roleId);

    @Select("select menu_id from sys_role_menu where role_id = #{roleId}")
    List<Integer> selectByRoleId(@Param("roleId")Integer roleId);

    @Insert("insert into sys_role_menu (role_id, menu_id) values (#{roleId}, #{menuId})")
    Integer inserts(RoleMenu roleMenu);
}
